package com.cc.blog.web.controller;

import com.cc.blog.common.annotation.ApiOperationLog;
import com.cc.blog.common.utils.Result;
import com.cc.blog.web.domain.dto.SearchArticlePageListReqDTO;
import com.cc.blog.web.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 搜索
 * @Author cc
 * @Date 2024/7/31 14:56
 */
@RestController
@Api(tags = "搜索")
@AllArgsConstructor
public class SearchController {

    private final SearchService searchService;

    @PostMapping("/article/search")
    @ApiOperation(value = "文章搜索")
    @ApiOperationLog(description = "文章搜索")
    public Result searchArticlePageList(@RequestBody @Validated SearchArticlePageListReqDTO searchArticlePageListReqDTO) {
        return searchService.searchArticlePageList(searchArticlePageListReqDTO);
    }
}
